﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_QuanLySanPham : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void ListView1_SelectedIndexChanging(object sender, ListViewSelectEventArgs e)
    {
        ListView1.SelectedIndex = e.NewSelectedIndex;
        int k = ListView1.SelectedIndex;

        DataKey currentDataKey = this.ListView1.DataKeys[k];

        string update_url = "ChiTietSanPham.aspx?ma=" + (string)currentDataKey["IDTaiLieu"].ToString();
        Response.Redirect(update_url);
    }

    protected void Deleted(object sender, ListViewDeletedEventArgs e)
    {
        if (e.Exception != null)
        {
            Session["msg_type"] = "error";
            Session["msg"] = "Đã có lỗi trong quá trình xóa!  Vui lòng thử lại!";
        }
        else
        {
            Session["msg_type"] = "success";
            Session["msg"] = "Đã hoàn tất xóa tài liệu!";
        }
    }
}